package first.demo;
import java.util.Random;
public class goodluck {
    public static void main(String[] args) {
        Random r = new Random();
        int j;
        int[] num={0,0,0,0,0,0};
        for(int i = 0;i < 1000;i ++)
        {
            j = r.nextInt(6) + 1;

            num[j-1] += 1;
        }
        double sum = 1000.0;
        for(int i = 0;i < 6;i ++)
        {
            System.out.printf("随机数%d出现的概率:", i+1);
            System.out.println(num[i]/sum);
        }
    }
}
